import { http } from '@/utils/request'

// 获取角色列表
export function getRoleList(params) {
  return http.get('/system/role', params)
}

// 添加角色
export function addRole(data) {
  return http.post('/system/role', data)
}

// 修改角色
export function updateRole(data) {
  return http.put('/system/role', data)
}

// 删除角色
export function deleteRole(roleId) {
  return http.delete(`/system/role/${roleId}`)
}

// 查询角色菜单权限
export function getRoleMenuTree(roleId) {
  return http.get(`/system/role/assign/${roleId}`)
}

// 分配角色菜单权限
export function assignRoleMenu(data) {
  return http.put('/system/role/assign', data)
}
